/*
2021-10-17
https://www.acwing.com/problem/content/4001/
*/ 
#include<cstring>
#include<iostream>
#include<algorithm>

using namespace std;
const int N=1e6+5;
int q[N];
string str;

int main()
{
    cin>>str;
    int n=str.size();
    
    for(int i=n-1,j=0;i>=0;i--,j++)
    {
        q[j]=str[i]-'0';
    }
    
    int res=0,idx=0;
    while(idx<n-1)
    {
        if(q[idx]%2)
        {
            int t=1;
            for(int i=idx;i<n;i++)
            {
                t+=q[i];
                q[i]=t%2;
                t/=2;
                if(!t) break;
            }
            
            if(t) q[n++]=1;
            res++;
        }
        idx++;
        res++;
    }
    cout<<res<<endl;
    
    return 0;
}
